home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / minix / libsrc~1.z / libsrc~1 / ptrace.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-12-28  |  284 b   |  17 lines

  1. #include "lib.h"
  2.  
  3. #define OK 0
  4.  
  5. PUBLIC long ptrace(req, pid, addr, data)
  6. int req, pid;
  7. long addr, data;
  8. {
  9.   M.m2_i1 = pid;
  10.   M.m2_i2 = req;
  11.   M.m2_l1 = addr;
  12.   M.m2_l2 = data;
  13.   if (callx(MM, PTRACE) == -1) return -1;
  14.   if (M.m2_l2 == -1) {errno = OK; return -1;}
  15.   return M.m2_l2;
  16. }
  17.